main(n){char c;long r;for(scanf("%ld",&r);~scanf("%c%d",&c,&n);){if(c=='*')r*=n;if(c=='+')r+=n;if(c=='/'){if(n==0){puts("ERROR");return 0;}r/=n;}if(c=='-')r-=n;if(r>2147483647){puts("ERROR");return 0;}}printf("%ld",r);}
